package com.ysyx.ysyx_admin.controller;

import com.ysyx.ysyx_admin.pojo.DriverPojo;
import com.ysyx.ysyx_admin.pojo.OrderPojo;
import com.ysyx.ysyx_admin.qo.OrderQo;
import com.ysyx.ysyx_admin.service.OrderPojoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 *
 * @description: xxxx接口/类
 * @author:Lenovo
 * @create:2023/4/19 9:43
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderPojoService orderPojoService;

    //        @RequestMapping(value = "/showOrder", method = RequestMethod.POST)
    @RequestMapping("/showOrder")
    public List<OrderQo> showDriver(@RequestBody OrderQo qo) {
        List<OrderQo> orderQos = orderPojoService.showDriver(qo);
        System.out.println(orderQos);
        return orderQos;
    }


    @RequestMapping(value = "/orderCount", method = RequestMethod.GET)
    public int orderCount() {
        int num = orderPojoService.orderCount();
        return num;
    }
}
